<include file="Public:header" />
<include file="Public:leftside" />
<div class="main-content">
	<div class="breadcrumbs breadcrumbs-fixed" id="breadcrumbs">
		<ul class="breadcrumb">
			<li> <i class="icon-home home-icon"></i>
				<a href="/">首页</a>
			</li>
			<li class="active">添加导航</li>
		</ul>
	</div>
<style>
input,select {
    width: 220px;
    background-color: #fff;
    border: 1px solid #dce4ec;
}
</style>
	<section class="vbox">

		<section class="scrollable wrapper">
			<div class="row padder-v">
				<div class="col-sm-9">
					<a href="{:U('Platform/shopnav')}" class="btn btn-sm btn-default"> 导航管理 </a>
					<a href="{:U('Platform/shopnav_add',array('cid'=>1))}" class="btn btn-sm btn-primary"><i class="fa fa-plus"></i> 添加导航 </a>
				</div>

			</div>
			<!-- 操作提示  start -->
			<section class="panel-default m-b-sm">
				<div class="alert alert-info">
					<p>
						<button type="button" class="close"><i class="fa fa-minus"></i></button>
						<i class="fa fa-hand-o-right m-r-xs"></i><strong>操作提示</strong>
					</p>
					<p class="alert-p m-l-xl"><i class="fa fa-caret-right m-r-xs"></i>添加导航</p>
				</div>
			</section>
			
			<!-- 操作提示  end -->

			<section class="panel panel-default">
				<header class="panel-heading font-bold"> 添加导航 </header>
				<div class="panel-body">
				<form action="{:U('Platform/shopnav_add_post')}" method="post" class="form form-horizontal" role="form">
		
				<div class="form-group">
					<label class="col-sm-2 control-label">菜单分类</label>
					<div class="controls">
						<select name="cid" id="navcid_select">
						<foreach name="navcats" item="vo">
							<php>$navcid_selected=$navcid==$vo['navcid']?"selected":"";</php>
							<option value="{$vo.navcid}" {$navcid_selected}>{$vo.name}</option>
						</foreach>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">父级</label>
					<div class="controls">
						<select name="parentid">
							<option value="0">/</option>
							{$nav_trees}
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">标签</label>
					<div class="controls">
						<input type="text" name="label" id="cr_label" value=""><span class="form-required">*</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">链接</label>
					<div class="controls">
						<input type="text" name="href" id="outlink_input" value="http://">
						<select name="xhref" id="selecthref" class="valid" aria-invalid="false">
							<option value="/" >快捷选择</option>
							<optgroup label="商城类目">
							 <volist name="ticketType_array" id="row">
							 	<?PHP
        		
					            	$numFlag	=	count( explode(',',$row['bids']) )-2;
									$flag	=	'';
									for( $i = 0; $i < $numFlag; $i++ ){
										$flag	.=	'├─';
									}
						        ?>
								<option value="{:U('list/index',array('id'=>$row['id']))}" title="{$row['name']}">{$flag}{$row['name']}</option>
							 </volist>
							</optgroup>	
							<optgroup label="文章分类">
							 <volist name="article_terms_array" id="row">
							 	<option value="{:U('article_list/index',array('id'=>$row['term_id']))}" title="{$row['name']}">{$row['name']}</option>
							 	 <volist name="row['child']" id="r">
							 	 	<option value="{:U('article_list/index',array('id'=>$r['term_id']))}" title="{$r['name']}">├─{$r['name']}</option>
								 </volist>
							 </volist>
							</optgroup>	
							<optgroup label="页面">
							 <volist name="article_posts_array" id="row">
							 	<option value="{:U('page/index',array('id'=>$row['id']))}" title="{$row['post_title']}">{$row['post_title']}</option>
							 </volist>
							</optgroup>	
						</select>
					</div>
					

				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">打开方式</label>
					<div class="controls">
						<select name="target">
							<option value="">默认</option>
							<option value="_blank">新窗口打开</option>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">图标</label>
					<div class="controls">
						<input type="text" name="icon" value="">&nbsp;&nbsp;<a href="http://www.fontawesome.com.cn/faicons/" target="_blank">查看图标</a>
					
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">自定义图标</label>
					<div class="controls">
					
						<div id="uploader" style="width:200px;overflow:hidden">
	                      <div id="fileList" class="uploader-list">
	                      <div id="WU_FILE_0" class="file-item thumbnail upload-state-done"><img class="img-responsive" src=""></div>
	                      <input type="hidden" name="UpFilePathInfo" value="">
	                     
	                      </div>
	                      <div id="cfilePicker">选择图片</div>
	                  	</div>
					</div>
				</div>
				
				<div class="form-group">
					<label class="col-sm-2 control-label">状态</label>
					<div class="controls">
						<select name="status">
							<option value="1">显示</option>
							<option value="0">隐藏</option>
						</select>
					</div>
				</div>
		
			<div class="form-group">
							<div class="col-sm-4 col-sm-offset-2" style="padding-left: 0px">
								<button class="btn btn-info formSubmit" id="form" type="button"><i class="icon-ok bigger-110"></i>提交</button>
							</div>
						</div>
		</form>
				</div>
			</section>

		</section>
	</section>

	<script>
	$(function(){
		$('#selecthref').change(function(){
			var title= $(this).find("option:selected").attr("title");
			var url = $(this).val();
			$('#cr_label').val(title);
			$('#outlink_input').val(url);
			
		})
	})
	</script>
	
<script>
//全局变量
    var GV = {
         DIMAUB: "/",
        JS_ROOT: "NewAdmin/js/",
        TOKEN: ""
    };
</script>
<script type="text/javascript" src="/NewAdmin/js/webuploader/webuploader.js"></script>
<script type="text/javascript" src="/NewAdmin/js/webuploader/getting-started.js"></script>
<link rel="stylesheet" href="/NewAdmin/css/webuploader.css" />
<script src="/NewAdmin/js/wind.js"></script>
<link href="/NewAdmin/js/artDialog/skins/default.css" rel="stylesheet" />
<script src="/NewAdmin/js/zhlmy.js"></script>
<script type="text/javascript">
var BASE_URL = '/NewAdmin/js/webuploader/';
var UPLOAD_SERVER='{:U("User/uploadify_wb")}';
var UpFilePathInfo='<?=$menuCurrent['UpFilePathInfo']?>';
$(function() {
	$('#uploader img').attr('src',UpFilePathInfo);
	$(':input[name="UpFilePathInfo"]').val(UpFilePathInfo);
	$("#uploader").setUploader(null,{uploadImgType:'normal',thumb:{height:102}});
	
});
</script>
	<include file="Public:footer" />